package self.hoy.demo.grainmall.product.vo;

import lombok.Data;
import lombok.ToString;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;

/**
 * @author hyh
 * @date 2020/7/23
 */
@Data
@ToString
public class SkuItemSaleAttrVo implements Serializable {
    private static final long serialVersionUID = -5378165587961980253L;
    private Long attrId;
    private String attrName;
    private String attrValue;
    private List<String> attrValues;

    public void setAttrValue(String attrValue) {
        this.attrValue = attrValue;
        if (attrValue != null) {
            String[] split = attrValue.split(",");
            attrValues = Arrays.asList(split);
        }
    }
}

